#!/usr/bin/env python3
"""GDP Analysis Script
Author: Juan Moises de la Serna
"""
import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv('gdp_extended.csv')
print(df.groupby('country')['gdp_bn_usd'].describe())

for country in df['country'].unique():
    sub = df[df['country'] == country]
    plt.plot(sub['year'], sub['gdp_bn_usd'], marker='o', label=country)

plt.title('GDP Evolution - Latin America')
plt.xlabel('Year')
plt.ylabel('GDP (Billions USD)')
plt.legend()
plt.tight_layout()
plt.savefig('gdp_evolution.png', dpi=150)
